<?php
require 'functions.php';

$session = new \Models\MySession();

Models\User::redirectLogged();

if ($_POST) {
    $userLogin = new Models\User();
    try {
       $userLogin->login($_POST['user_name'], $_POST['password']); 
    } catch (Exception $exc) {
        echo $exc->getMessage();
    }  
 }
       
$data['userGreeting'] = '';
@$data['isLogged'] = $_SESSION['isLogged'];
$data['title'] = 'Login';
$data['content'] = './public_html/login_public.php';
$data['header'] = './inc/header.php';
render($data, $layout);
